package com.aaa.a1104.demo02;

import java.util.function.Supplier;

/**
 * @author 荆豪峰
 * @version 1.0
 */
public class Test03 {
    public static void main(String[] args) {

        Student s=new Student("asd","19");


      //   Supplier<String> supplier=()->s.getAge();

        Supplier<String> supplier=s::getAge;


        System.out.println(supplier.get());


    }
}
class Student{
    private String name;
    private String age;

    public Student(String name, String age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }
}